package UnOfficeDeTourisme;

/**
 * Interface definition : Touriste
 * 
 * @author OpenORB Compiler
 */
public class _TouristeStub extends org.omg.CORBA.portable.ObjectImpl
        implements Touriste
{
    static final String[] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/Touriste:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = UnOfficeDeTourisme.TouristeOperations.class;

    /**
     * Read accessor for nomT attribute
     * @return the attribute value
     */
    public String nomT()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_nomT",true);
                    _input = this._invoke(_output);
                    return _input.read_string();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_nomT",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.TouristeOperations _self = (UnOfficeDeTourisme.TouristeOperations) _so.servant;
                try
                {
                    return _self.nomT();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Read accessor for prenomT attribute
     * @return the attribute value
     */
    public String prenomT()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_prenomT",true);
                    _input = this._invoke(_output);
                    return _input.read_string();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_prenomT",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.TouristeOperations _self = (UnOfficeDeTourisme.TouristeOperations) _so.servant;
                try
                {
                    return _self.prenomT();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Read accessor for mailT attribute
     * @return the attribute value
     */
    public String mailT()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_mailT",true);
                    _input = this._invoke(_output);
                    return _input.read_string();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_mailT",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.TouristeOperations _self = (UnOfficeDeTourisme.TouristeOperations) _so.servant;
                try
                {
                    return _self.mailT();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation demanderAvis
     */
    public String demanderAvis(UnOfficeDeTourisme.Visite v)
        throws UnOfficeDeTourisme.AvisInvalideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("demanderAvis",false);
                    UnOfficeDeTourisme.VisiteHelper.write(_output,v);
                    _input = this._invoke(_output);
                    String _arg_ret = _input.read_string();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.AvisInvalideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.AvisInvalideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("demanderAvis",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.TouristeOperations _self = (UnOfficeDeTourisme.TouristeOperations) _so.servant;
                try
                {
                    return _self.demanderAvis( v);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
